package com.oneday.nuo.base.security.auth;

import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 权限过滤器
 * @Author: liushuai
 * @Date: 2021/2/10 9:06
 * @param : * @param null
 * @return :
 **/
@EnableWebSecurity
@Component
public class NuoFilterSecurityMetadataSource implements FilterInvocationSecurityMetadataSource {




    /**
     * 此方法用于鉴权过程中获取当前的请求URL需要哪种权限
     * @Author: liushuai
     * @Date: 2021/2/10 9:07
     * @param : * @param o
     * @return :java.util.Collection<org.springframework.security.access.ConfigAttribute>
     **/
    @Override
    public Collection<ConfigAttribute> getAttributes(Object o) throws IllegalArgumentException {
        return new ArrayList<ConfigAttribute>();
    }

    @Override
    public Collection<ConfigAttribute> getAllConfigAttributes() {
        return new ArrayList<ConfigAttribute>();
    }

    @Override
    public boolean supports(Class<?> aClass) {
        return true;
    }
}
